home *** CD-ROM | disk | FTP | other *** search
/ The CICA Windows Explosion! / The CICA Windows Explosion! - Disc 2.iso / programr / ole2book.zip / BOOKGUID.H < prev    next >
C/C++ Source or Header  |  1993-09-16  |  5KB  |  209 lines

  1. /*
  2.  * BOOKGUID.H
  3.  *
  4.  * CLSIDs and IIDs defined for the Windows Object book.  This file
  5.  * centralizes them all so we can keep track of which ones are used.
  6.  * The file also includes a number of useful macros that all samples
  7.  * might be interested in as well as including DEBUG.H and WIN1632.H.
  8.  *
  9.  * Copyright (c)1993 Microsoft Corporation, All Rights Reserved
  10.  *
  11.  * Kraig Brockschmidt, Software Design Engineer
  12.  * Microsoft Systems Developer Relations
  13.  *
  14.  * Internet  :  kraigb@microsoft.com
  15.  * Compuserve:  >INTERNET:kraigb@microsoft.com
  16.  */
  17.  
  18.  
  19. #ifndef _BOOKGUID_H_
  20. #define _BOOKGUID_H_
  21.  
  22.  
  23. #include <win1632.h>
  24. #include <debug.h>
  25.  
  26. #ifdef INITGUIDS
  27. #include <initguid.h>
  28. #endif
  29.  
  30.  
  31. //Types that OLE2.H et. al. leave out
  32. typedef LPVOID FAR * LPLPVOID;
  33.  
  34. #ifdef _OLE2_H_   //May not include ole2.h at all times.
  35. typedef POINTL FAR * LPPOINTL;
  36.  
  37. //Useful macros.
  38. #define SETFormatEtc(fe, cf, asp, td, med, li)   \
  39.     {\
  40.     (fe).cfFormat=cf;\
  41.     (fe).dwAspect=asp;\
  42.     (fe).ptd=td;\
  43.     (fe).tymed=med;\
  44.     (fe).lindex=li;\
  45.     };
  46.  
  47. #define SETDefFormatEtc(fe, cf, med)   \
  48.     {\
  49.     (fe).cfFormat=cf;\
  50.     (fe).dwAspect=DVASPECT_CONTENT;\
  51.     (fe).ptd=NULL;\
  52.     (fe).tymed=med;\
  53.     (fe).lindex=-1;\
  54.     };
  55.  
  56.  
  57. #define SETRECTL(rcl, l, t, r, b) \
  58.     {\
  59.     (rcl).left=l;\
  60.     (rcl).top=t;\
  61.     (rcl).right=r;\
  62.     (rcl).bottom=b;\
  63.     }
  64.  
  65. #define SETSIZEL(szl, h, v) \
  66.     {\
  67.     (szl).cx=h;\
  68.     (szl).cy=v;\
  69.     }
  70.  
  71.  
  72. #define RECTLFROMRECT(rcl, rc)\
  73.     {\
  74.     (rcl).left=(long)(rc).left;\
  75.     (rcl).top=(long)(rc).top;\
  76.     (rcl).right=(long)(rc).right;\
  77.     (rcl).bottom=(long)(rc).bottom;\
  78.     }
  79.  
  80.  
  81. #define RECTFROMRECTL(rc, rcl)\
  82.     {\
  83.     (rc).left=(int)(rcl).left;\
  84.     (rc).top=(int)(rcl).top;\
  85.     (rc).right=(int)(rcl).right;\
  86.     (rc).bottom=(int)(rcl).bottom;\
  87.     }
  88.  
  89.  
  90. #define POINTLFROMPOINT(ptl, pt) \
  91.     { \
  92.     (ptl).x=(long)(pt).x; \
  93.     (ptl).y=(long)(pt).y; \
  94.     }
  95.  
  96.  
  97. #define POINTFROMPOINTL(pt, ptl) \
  98.     { \
  99.     (pt).x=(int)(ptl).x; \
  100.     (pt).y=(int)(ptl).y; \
  101.     }
  102.  
  103. //Here's one that should be in windows.h
  104. #define SETPOINT(pt, h, v) \
  105.     {\
  106.     (pt).x=h;\
  107.     (pt).y=v;\
  108.     }
  109.  
  110. #define SETPOINTL(ptl, h, v) \
  111.     {\
  112.     (ptl).x=h;\
  113.     (ptl).y=v;\
  114.     }
  115.  
  116. #endif  //_OLE2_H_
  117.  
  118.  
  119.  
  120. /*
  121.  * GUIDs
  122.  *
  123.  * For this book the author has been allocated the GUIDs in the range:
  124.  *     00021100-0000-0000-C000-000000000046
  125.  *     000211FF-0000-0000-C000-000000000046
  126.  *
  127.  * Gaps in the sequences are GUIDS used by the author for purposes other
  128.  * than this book, e.g. magazine articles.
  129.  */
  130.  
  131.  
  132. //GUIDs for Chapter 4
  133.  
  134. //Koala
  135. DEFINE_OLEGUID(CLSID_Koala,              0x00021102, 0, 0);
  136.  
  137.  
  138. //Polyine
  139. DEFINE_OLEGUID(CLSID_Polyline4,          0x00021103, 0, 0);
  140. DEFINE_OLEGUID(IID_IPolyline4,           0x00021104, 0, 0);
  141. DEFINE_OLEGUID(IID_IPolylineAdviseSink4, 0x00021105, 0, 0);
  142.  
  143.  
  144. //GUIDs for Chapter 5
  145.  
  146. //Patron Files for Chapter 5 and beyond:  becomes Patron's App ID
  147. DEFINE_OLEGUID(CLSID_PatronPages,        0x00021106, 0, 0);
  148.  
  149. //Schmoo Files for Chapter 5 and beyond:  becomes Schmoo's App ID
  150. DEFINE_OLEGUID(CLSID_Schmoo2Figure,      0x00021107, 0, 0);
  151.  
  152. //Polyine
  153. DEFINE_OLEGUID(CLSID_Polyline5,          0x00021108, 0, 0);
  154. DEFINE_OLEGUID(IID_IPolyline5,           0x00021109, 0, 0);
  155. DEFINE_OLEGUID(IID_IPolylineAdviseSink5, 0x0002110A, 0, 0);
  156.  
  157.  
  158. //GUIDs for Chapter 6
  159.  
  160. //DataObject variations for the data set.  Same server supplies them all.
  161. DEFINE_OLEGUID(CLSID_DataObjectSmall,    0x0002110B, 0, 0);
  162. DEFINE_OLEGUID(CLSID_DataObjectMedium,   0x0002110C, 0, 0);
  163. DEFINE_OLEGUID(CLSID_DataObjectLarge,    0x0002110D, 0, 0);
  164.  
  165. //Polyine
  166. DEFINE_OLEGUID(CLSID_Polyline6,          0x0002110E, 0, 0);
  167. DEFINE_OLEGUID(IID_IPolyline6,           0x0002110F, 0, 0);
  168. DEFINE_OLEGUID(IID_IPolylineAdviseSink6, 0x00021110, 0, 0);
  169.  
  170. /*
  171.  * The same numbers are defined in OLEGUID.H as CLSID_StaticMetafile
  172.  * and CLSID_StaticDib.  Those will define the symbols but the actual
  173.  * values are not in OLE2.LIB as all IIDs and other CLSIDs are.  To
  174.  * use the GUIDs, we have to define our own labels for them but still
  175.  * using the same GUIDs.
  176.  */
  177.  
  178. DEFINE_OLEGUID(CLSID_FreeMetafile,       0x00000315, 0, 0);
  179. DEFINE_OLEGUID(CLSID_FreeDib,            0x00000316, 0, 0);
  180.  
  181.  
  182. //GUIDS for Chapter 7
  183.  
  184. //Data Transfer Component Object
  185. DEFINE_OLEGUID(CLSID_DataTransferObject, 0x00021111, 0, 0);
  186.  
  187.  
  188. //Schmoo in chapter 10 uses CLSID_Schmoo2Figure above.
  189.  
  190.  
  191. //GUIDs for Chapter 11
  192.  
  193. //HSchmoo is registered under CLSID_Schmoo2Figure
  194.  
  195. //Polyine
  196. DEFINE_OLEGUID(CLSID_Polyline11,         0x00021112, 0, 0);
  197.  
  198.  
  199. //GUIDs for Chapter 12
  200.  
  201. //LinksAssistant
  202. DEFINE_OLEGUID(CLSID_LinksAssistant,     0x00021113, 0, 0);
  203.  
  204. //OLE 2.0 SDK forgot this one.
  205. DEFINE_OLEGUID(IID_IOleUILinkContainer,  0x00021114, 0, 0);
  206.  
  207.  
  208. #endif //_BOOKGUID_H_
  209.